package core;

public enum MXitErrorType {
	UNKNOWN						(-1),
	UNDEFINED_ERR				(99),
	NO_ERROR					(0),
	INVALID_REG_PASS			(3),
	ACCOUNT_EXPIRED				(4),
	CONTACT_NOT_FOUND_DEL		(7),
	MSG_DELIVERY_FAIL			(15),
	REDIRECT_TO_DIFF_HOST		(16),
	SESSION_ID_INVALID			(40),
	NOT_LOGGED_IN				(42),
	;
	
	public final static MXitErrorType[] errCodes;
	
	static{
		errCodes = new MXitErrorType[80];
		for(MXitErrorType code:MXitErrorType.values()){
			if (code != UNKNOWN) {
				errCodes[code.getId()] = code;
			}
		}
	}
	
	static MXitErrorType code(int id){
		return (id != -1 ? errCodes[id]:UNKNOWN);
	}
	
	private final int id;
	
	MXitErrorType(int id){
		this.id=id;
	}
	
	public int getId(){ return id; };
}
